import { _decorator, Component } from 'cc';
import MutiLang from 'db://cocos-ext/base/MutiLang';
import { games } from 'yycore';

import YYExt from '../yyExt/YYExt';

const { ccclass, property } = _decorator;

/**
 * 绑定游戏场景，监听无游戏房间，并给出消息框提示
 */
@ccclass('TipsNoRoom')
export class TipsNoRoom extends Component {

    start() {
        const gameInfo = YYExt.cfgGameInfo;
        if (!gameInfo || gameInfo.rooms.length == 0) {
            games.ui.messageBox(MutiLang.getString("no_room_tip"));
        }
    }

}

